<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" src="JS/jquery-1.6.min.js"></script>
     <link rel="stylesheet" href="style.css" type="text/css" />
<link href="css/jquery.mobile-1.1.0.css" rel="stylesheet">

        <script>
            $(document).ready(function(){
                $("#con").live("submit",function(event){
                    
            event.preventDefault(); 
            
            login=$("#log").attr("value");
                    pass=$("#pass").attr("value");
                
                    $.post("loginadmin.php",{ log :login,password :pass},
                    function(data) {
                        if(data=="admin")            
                    
                        {                  
                            window.location = 'adminactions.php';

                        }
                        else if (data=="manager")
                        {
                       window.location = 'manager_actions.php';
  
                        }
                    
                    });
                });
            });
        
        </script>

    </head>
    <body>

    <div data-role="header" data-theme="a"> 
                 <h1>Connexion !</h1>
             </div>
    <div class="ui-body ui-body-a">
        <form id="con">
            <div id="loginform">
                <label>Login: </label><input id="log" type="text" maxlength="15" required> </br>
                <label>Password: </label><input id="pass" type="password" required></br>

                <button type=submit>Submit</button>
            </div>
        </form>
    </div>
</body>
        
    
</html>

<?php
//        session_start();
//
//        $_SESSION['admin'] = "deconnect";
//
//        if ($_SESSION['admin'] == "deconnect") {
//
//            // session_destroy();
//        }
//        if ($_SESSION['admin'] == "connected") {
//            echo "connected";
//        }
        ?>

